<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>火云鞋神购物鞋店--个人中心</title>
    <meta name="" content=""/>
    <meta name="">
    <link rel="shortcut icon" href="../img/favicon_2.ico"/>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/base.css">
    <!--<link rel="stylesheet" href="bootstrap.min.css">-->
</head>
<body>
<div class="content" style="height: 740px ">
    <div class="main">
        <!--更改-->
        <div class="hd">
            <h3>账户管理</h3>
        </div>
        <!--更改-->
        <div class="dd" >
            <div class="nav_right">
                <ul>
                    <li><a href="http://localhost:63343/qiguai/html/person.html" style="font-weight: bolder">基本资料</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/person2.html">头像照片</a></li>
                </ul>
            </div>

            <!--更改aftersale_detail_txt_ac-->
            <div class="show"  style="padding-left: 50px;padding-top: 30px;background-color: white;border-top: 1px black solid">
                <div id="selectId">
                <!--<div>
                    亲爱的
                    <b>*******</b>
                    ，填写真实的资料，有助于好友找到你哦。
                </div>
                <div>
                    <form style="line-height: 50px">
                        <p><label>当前头像：</label><img
                                src="https://wwc.alicdn.com/avatar/getAvatar.do?userId=3861074290&width=80&height=80&type=sns"
                                alt=""></p>
                        <p><label>昵称：</label><input type="text" class="form-control" style="border: 1px dotted black" placeholder=""></p>
                        <p><label >性别：</label>
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
                                男
                            </label>
                        </div>
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
                                女
                            </label>
                        </div>
                        <div style="clear: both"></div>
                        </p>
                        <p>
                            <label>居住地：</label>
                            <input type="text" class="form-control" style="border: 1px dotted black" placeholder="Address"></p>
                    </form>
                </div>-->
                </div>
                <!--<div style="padding-bottom: 30px;border-top: 1px solid bisque;padding-top: 10px">
                    <input class="submit" type="submit" value="保存" style="width: 100%;height:37px; background-color: red; color: white;font-size: 15px">
                </div>-->
            </div>
        </div>
    </div>
    <nav class="nav_aftersale" >
        <div class="dropdown_aftersale">
            <div class="list_txt font_family ">
                <ul class="li">
                    <li><a href="http://localhost:63343/qiguai/html/CollectShow.html?_ijt=obhlshosup6n9gvu1ojnfh003s" target="_top" >我的收藏</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/uaftsale.html" target="_top" >我的售后</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/ucoupon.html" target="_top" >我的优惠券</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/ulogistic.html" target="_top" >我的物流</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/orderpush.html" target="_top" >我的订单</a></li>
                   <!-- <li><a href="http://localhost:63343/qiguai/html/CollectShow.html" target="_top">关注的商品</a></li>-->
                    <!--<li><a href="#">我的足迹</a></li>-->
                    <li><a href="http://localhost:63343/qiguai/html/person.html"  style="font-weight: bolder">个人信息</a></li>
                    <li><a href="http://localhost:63343/qiguai/html/adress.html" >收货地址</a></li>
                </ul>
            </div>
        </div>
    </nav>
</div>
<script src="../js/cookie.js"></script>
<script src="../js/jquery-3.3.1.min.js"></script>
<script>

    var a = getCookie("userid")

    $.getJSON("http://localhost:8080/selectUser?userId=" + a,function (data) {
        console.log(data)
        var html=''
        html += `
                <div>
                    亲爱的
                    <b>${data.userName}</b>
                    ，填写真实的资料，有助于好友找到你哦。
                </div>
                <div>
                    <form style="line-height: 50px" action="http://localhost:8080/updateUser/${data.userId}"  >
                        <p><label>当前头像：</label><img
                                src="../photo/${data.userImg}"
                               style="width: 90px;height: 90px" alt=""></p>
                        <p><label>昵称：</label><input type="text" class="form-control" name="userCard" style="border: 1px solid black;font-size: 16px" placeholder="" value="${data.userCard}"></p>
                        <p><label >性别：</label>
                        `

        console.log(data.userSex)
            if(data.userSex == "男" || data.userSex == "" || data.userSex == "null"){
                html +=    `
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="userSex" id="optionsRadios1" value="男" checked>
                                男
                            </label>
                        </div>
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="userSex" id="optionsRadios2" value="女">
                                女
                            </label>
                        </div>
                        `
            }else if(data.userSex == "女"){
                html +=    `
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="userSex" id="optionsRadios1" value="男" >
                                男
                            </label>
                        </div>
                        <div class="radio-inline" >
                            <label>
                                <input type="radio" name="userSex" id="optionsRadios2" value="女" checked>
                                女
                            </label>
                        </div>
                        `
        }
        html +=    `
                        <div style="clear: both"></div>
                        </p>
                        <p >
                            <div><label style="">收货地址：</label></div>
                            <textarea class="form-control" rows="5" disabled="disabled" style="border: 1px solid black;width: 200px;font-size: 15px" name="userAddress"  value="">${data.userAddress}</textarea></p>
                    <div style="padding-bottom: 30px;border-top: 1px solid bisque;padding-top: 10px">
                    <input class="submit" type="submit" value="保存" onclick="f()" style="width: 20%;height:37px; background-color: red; color: white;font-size: 15px">
                    </div>
                    </form>
                </div>
        `

        $("#selectId").append(html)
    })

function f() {
    alert("修改成功！！！！")
}

</script>
</body>
</html>